#pragma once

#include "View.h"
#include "RTCamera.h"

namespace mgfx
{
	class HLSLEffect;
	class Texture;
}

namespace rt
{
	class Scene;
	class RT_Memory;
	class Camera;

	class RtView : public mcore::View
	{
	public:
		RtView()
		{
			mName = "Intro View";
			mTotalTime = 0.0f;
		}

		virtual void load();
		virtual void unload();
		virtual void onResize() {}
		virtual void update(float dt);
		virtual void draw();

		virtual bool onWindowMessage(UINT msg, WPARAM wParam, LPARAM lParam);

	private:
		ID3D11Buffer * mVertexBuffer;
		ID3D11Buffer * mIndexBuffer;

		mgfx::HLSLEffect * mHLSLEffect;
		mgfx::Texture * mRenderTexture;
		mgfx::Texture * mPreviewRenderTexture;
		int mRenderWidth;
		int mRenderHeight;
		int mPreviewRenderWidth;
		int mPreviewRenderHeight;

		float mTotalTime;

		int mPrevMousePosX, mPrevMousePosY;

		Scene * mScene;
		Camera * mCamera;

		bool mIsUserInput;

		RT_Memory * mRenderTarget;
		RT_Memory * mPreviewRenderTarget;
	};
}